import React from "react";
import dva, { dynamic, router } from "dva";
import Example from "./component/Example";
import { createHashHistory } from 'history';
import { homepage } from '../package.json';
const { Router, Route, Switch, Redirect } = router;
// import app from './app';

// 1. Initialize
// const history = createHistory();
const app = dva({
  history: createHashHistory({
    basename: '/'
  })
});
// 2. Plugins
// app.use(createLoading());

// 3. Model
// app.model(require('./models/example').default);

// 4. Router
app.router(() => {
  <Router>
    <Switch>
      <Route path="/" exact component={ React.createElement(Example,null,null)} />
    </Switch>
  </Router>;
});
// // -> 初始化路由
// app.router(({ history, app }) => (
//   <ConfigProvider locale={zh_CN}>
//     <Router history={history}>{createRoutes(app)}</Router>
//   </ConfigProvider>
// ));
// 5. Start
app.start("#root");
